<?php

/**
 * @author shuang
 * @date 2017-6-2 15:41:46
 */
use common\components\MTools;

$images = explode(",", $images);
$imgCount = count($images) - 1;
?>
<div id="slider" class="mui-slider" data-slider="1">
    <div class="mui-slider-group mui-slider-loop">
        <!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
        <div class="mui-slider-item mui-slider-item-duplicate">
            <a href="javascript:;">
                <img src="<?php echo MTools::Qiniu480($images[0]); ?>" onerror="this.src='../images/default.png'">
            </a>
        </div>
        <?php foreach ($images as $item): ?>
            <div class="mui-slider-item">
                <a href="javascript:;">
                    <img src="<?php echo MTools::Qiniu480($item); ?>" onerror="this.src='../images/default.png'">
                </a>
            </div>
        <?php endforeach; ?>
        <!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
        <div class="mui-slider-item mui-slider-item-duplicate">
            <a href="javascript:;">
                <img src="<?php echo MTools::Qiniu480($images[$imgCount]); ?>" onerror="this.src='../images/default.png'"> 
            </a>
        </div>
    </div>
    <div class="mui-slider-indicator">
        <?php for ($i = 0; $i <= $imgCount; $i++): ?>
            <div class="mui-indicator <?php echo $i == 0 ? "mui-active" : null; ?>"></div>
        <?php endfor; ?>
    </div>
</div>